﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using Stock.Model;

namespace Stock.ViewModel
{
    public class StockSpriteViewModel : ViewModelBase
    {
        private StockViewModel _model;

        public StockViewModel Stock { get => _model; set => Set(ref _model, value); }

        private string _notifyText;

        public string NotifyText { get => _notifyText; set => Set(ref _notifyText, value); }

        private double _todayTotalPrice;
        private double _totalPrice;

        private string s1, s2;

        /// <summary>
        /// 今日盈亏
        /// </summary>
        public double TodayTotalPrice { get => _todayTotalPrice; set => Set(ref _todayTotalPrice, value); }

        public string TodayTotalPriceString { get => s1; set => Set(ref s1, value); }

        /// <summary>
        /// 总盈亏
        /// </summary>
        public double TotalPrice { get => _totalPrice; set => Set(ref _totalPrice, value); }

        public string TotalPriceString { get => s2; set => Set(ref s2, value); }

        public Action DoubleClick { get; set; }

        public Action Hidden { get; set; }

        public Action Exit { get; set; }

        public RelayCommand DoubleClickCmd => new RelayCommand(DoubleClick);

        public RelayCommand HiddenCmd => new RelayCommand(Hidden);

        public RelayCommand ExitCmd => new RelayCommand(Exit);
    }
}
